home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00387_ShortLong Lookup.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  2.4 KB  |  89 lines

  1. property iENCcstPtr, iStoLCHRO, iStoLEPIS, iStoLENCa, iPrevItem, iENCwildLU, iCurrentLU
  2. global gFTsearchscope, gModeState, oIndexMediator, gNumofHits, oIndexScroller
  3.  
  4. on birth me
  5.   return me
  6. end
  7.  
  8. on mPrepEntryLookup me
  9.   put "Building correspondence tables" into field "Status"
  10.   set iStoLENCa to value(field "LU_A_ENCY")
  11.   if not objectp(iStoLENCa) then
  12.   end if
  13.   set iENCcstPtr to the number of cast "LU_A_ENCY" - 1
  14.   unLoadCast(iENCcstPtr + 1)
  15.   set iENCwildLU to [:]
  16.   put "Triggiani tables assembled." into field "Status"
  17. end
  18.  
  19. on mPrepCurrentLU me
  20.   set iCurrentLU to [:]
  21. end
  22.  
  23. on mDumpCurrentLU me
  24.   put iCurrentLU
  25. end
  26.  
  27. on mGetCurrLUItemNum me, pNtry
  28.   return getPos(iCurrentLU, pNtry)
  29. end
  30.  
  31. on mSetOneFTfromLU me, pEntryNum, pName
  32.   set LmyitemK to 1
  33.   if pEntryNum = 0 then
  34.     set Lthisname to pName
  35.   else
  36.     set Lthisname to mGetThisEntryName(oIndexMediator, gModeState, LmyitemK, pEntryNum)
  37.   end if
  38.   if mWhatFSlistType(oIndexScroller) = 1 then
  39.     set lx to getaProp(iCurrentLU, Lthisname)
  40.     if not voidp(lx) then
  41.       return lx
  42.     else
  43.       set Lthischar to hFilterSearchChars(string(Lthisname))
  44.       set LthisItem to hConvertAlphaToItem(Lthischar)
  45.       set LthisLUgroup to mCaptureLU(me, #ENCY, LthisItem, Lthischar)
  46.       set Lthislongname to getaProp(LthisLUgroup, string(Lthisname))
  47.       if voidp(Lthislongname) then
  48.         hputmsg("!!Valid long name cannot be made from >" & Lthisname & "<" & RETURN & "{mBuildOneFTfromLU at pEntryNum = " & pEntryNum & "}")
  49.         hReportStatus("Sorry, having trouble creating an entry name for the index.")
  50.         hearit(gNopeSND)
  51.         hputmsg("!>mSetOneFTfromLU: failed to lookup long name for " & Lthisname)
  52.         hputmsg("! having been given Lthischar=" & Lthischar && "Lthisitem=" & LthisItem)
  53.         abort()
  54.       end if
  55.       addProp(iCurrentLU, Lthisname, Lthislongname)
  56.     end if
  57.     return Lthislongname
  58.   else
  59.     return Lthisname
  60.   end if
  61. end
  62.  
  63. on mGetCurrLUShort me, pLong
  64.   return getPropAt(iCurrentLU, getPos(iCurrentLU, pLong))
  65. end
  66.  
  67. on mCaptureLU me, pMode, pItem, pChar
  68.   if pItem = 1 then
  69.     return iStoLENCa
  70.   else
  71.     if pItem <> iPrevItem then
  72.       set iPrevItem to pItem
  73.       set iENCwildLU to mLoadLU(me, pItem, pChar)
  74.       return iENCwildLU
  75.     else
  76.       return iENCwildLU
  77.     end if
  78.   end if
  79. end
  80.  
  81. on mLoadLU me, pItem, pAlpha
  82.   set lit to value(field (iENCcstPtr + pItem))
  83.   if not objectp(lit) then
  84.     abort()
  85.   end if
  86.   unLoadCast(iENCcstPtr + pItem)
  87.   return lit
  88. end
  89.